package com.funtl.hello.spring.cloud.alibaba.rocketmq.provider.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;

/**
 * @Author: lz
 * @Description:
 * @Date: 2019/8/27
 */
@Service
public class ProviderService {
    @Autowired
    private MessageChannel output;

    public void send(String message) {
        MessageBuilder builder = MessageBuilder.withPayload(message);
        Message msg = builder.build();
        output.send(msg);
    }
}
